<!DOCTYPE html>
<html lang="en-gb" dir="ltr">

    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Dropbar - UIkit tests</title>
        <script src="js/test.js"></script>
        <style>

            body { padding-bottom: 500px; }

            .test {
                display: block;
                position: relative;
                width: 100%;
            }

            .test-boundary { border: 1px dashed rgba(0,0,0,0.2); }

        </style>
    </head>

    <body>

        <div class="uk-container">

            <h1>Dropbar</h1>

            <div class="uk-margin">
                <select id="js-size-switcher" class="uk-select uk-form-width-small" aria-label="Size switcher">
                    <option value="">Default</option>
                    <option value="uk-dropbar-large">Large</option>
                </select>
            </div>

            <div class="uk-child-width-1-4@m uk-grid-match" uk-grid>
                <div>

                    <div class="uk-drop uk-dropbar uk-dropbar-top test">
                        <h3>Top</h3>
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
                    </div>

                </div>
                <div>

                    <div class="uk-drop uk-dropbar uk-dropbar-bottom test">
                        <h3>Bottom</h3>
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
                    </div>

                </div>
                <div>

                    <div class="uk-drop uk-dropbar uk-dropbar-left test">
                        <h3>Left</h3>
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
                    </div>

                </div>
                <div>

                    <div class="uk-drop uk-dropbar uk-dropbar-right test">
                        <h3>Right</h3>
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
                    </div>

                </div>
            </div>

            <h2>Navbar</h2>

        </div>

        <nav class="uk-navbar-container uk-margin-top">
            <div class="uk-container">
                <div uk-navbar>
                    <div class="uk-navbar-left">

                        <ul class="uk-navbar-nav">
                            <li class="uk-active"><a href="#">Active</a></li>
                            <li><a href="#">Item</a></li>
                            <li><a href="#">Item</a></li>
                        </ul>

                    </div>
                </div>
            </div>
        </nav>

        <div class="uk-drop uk-dropbar uk-dropbar-top test">
            <div class="uk-container">

                <div class="uk-child-width-1-3" uk-grid>
                    <div>
                        <ul class="uk-nav uk-navbar-dropdown-nav">
                            <li class="uk-active"><a href="#">Active</a></li>
                            <li class="uk-parent">
                                <a href="#">Parent</a>
                                <ul class="uk-nav-sub">
                                    <li><a href="#">Sub item</a></li>
                                    <li><a href="#">Sub item</a>
                                        <ul>
                                            <li><a href="#">Sub item</a></li>
                                            <li><a href="#">Sub item</a></li>
                                        </ul>
                                    </li>
                                </ul>
                            </li>
                            <li class="uk-parent">
                                <a href="#">Parent</a>
                                <ul class="uk-nav-sub">
                                    <li class="uk-active"><a href="#">Active</a></li>
                                    <li><a href="#">Sub item</a></li>
                                </ul>
                            </li>
                            <li class="uk-nav-header">Header</li>
                            <li><a href="#"><span class="uk-margin-xsmall-right" uk-icon="icon: table"></span> Item</a></li>
                            <li><a href="#"><span class="uk-margin-xsmall-right" uk-icon="icon: thumbnails"></span> Item</a></li>
                            <li class="uk-nav-divider"></li>
                            <li><a href="#"><span class="uk-margin-xsmall-right" uk-icon="icon: trash"></span> Item</a></li>
                        </ul>
                    </div>
                    <div>
                        <ul class="uk-nav uk-nav-secondary">
                            <li class="uk-active"><a href="#"><div>Active<div class="uk-nav-subtitle">Subtitle lorem ipsum dolor sit amet, consectetur adipiscing.</div></div></a></li>
                            <li><a href="#"><div>Item<div class="uk-nav-subtitle">Subtitle lorem ipsum dolor sit amet, consectetur adipiscing.</div></div></a></li>
                            <li><a href="#"><div>Item<div class="uk-nav-subtitle">Subtitle lorem ipsum dolor sit amet, consectetur adipiscing.</div></div></a></li>
                            <li><a href="#"><div>Item<div class="uk-nav-subtitle">Subtitle lorem ipsum dolor sit amet, consectetur adipiscing.</div></div></a></li>
                        </ul>
                    </div>
                    <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
                </div>

            </div>
        </div>

        <div class="uk-container uk-margin-medium-top">

            <h2>Animation</h2>

            <div class="uk-child-width-1-4@m" uk-grid>
                <div>
                    <div class="test-boundary uk-overflow-auto uk-height-large uk-resize-vertical">

                        <nav class="uk-navbar-container" uk-navbar>
                            <div class="uk-navbar-center">

                                <ul class="uk-navbar-nav">
                                    <li>
                                        <a href>Fade</a>
                                        <div class="uk-dropbar uk-dropbar-top" uk-drop="target-y: !.uk-navbar-container; stretch: x; animate-out: true">
                                            <ul class="uk-nav uk-navbar-dropdown-nav">
                                                <li class="uk-active"><a href="#">Active</a></li>
                                                <li><a href="#">Item</a></li>
                                                <li><a href="#">Item</a></li>
                                            </ul>
                                        </div>
                                    </li>
                                </ul>

                            </div>
                        </nav>

                    </div>
                </div>
                <div>
                    <div class="test-boundary uk-overflow-auto uk-height-large uk-resize-vertical">

                        <nav class="uk-navbar-container" uk-navbar>
                            <div class="uk-navbar-center">

                                <ul class="uk-navbar-nav">
                                    <li>
                                        <a href>Slide Top</a>
                                        <div class="uk-dropbar uk-dropbar-top" uk-drop="target-y: !.uk-navbar-container; stretch: x; animation: slide-top; animate-out: true">
                                            <ul class="uk-nav uk-navbar-dropdown-nav">
                                                <li class="uk-active"><a href="#">Active</a></li>
                                                <li><a href="#">Item</a></li>
                                                <li><a href="#">Item</a></li>
                                            </ul>
                                        </div>
                                    </li>
                                </ul>

                            </div>
                        </nav>

                    </div>
                </div>
                <div>
                    <div class="test-boundary uk-overflow-auto uk-height-large uk-resize-vertical">

                        <nav class="uk-navbar-container" uk-navbar>
                            <div class="uk-navbar-center">

                                <ul class="uk-navbar-nav">
                                    <li>
                                        <a href>Slide Left</a>
                                        <div class="uk-dropbar uk-dropbar-left" uk-drop="target-y: !.uk-navbar-container; stretch: y; animation: slide-left; animate-out: true">
                                            <ul class="uk-nav uk-navbar-dropdown-nav">
                                                <li class="uk-active"><a href="#">Active</a></li>
                                                <li><a href="#">Item</a></li>
                                                <li><a href="#">Item</a></li>
                                            </ul>
                                        </div>
                                    </li>
                                </ul>

                            </div>
                        </nav>

                    </div>
                </div>
                <div>
                    <div class="test-boundary uk-overflow-auto uk-height-large uk-resize-vertical">

                        <nav class="uk-navbar-container" uk-navbar>
                            <div class="uk-navbar-center">

                                <ul class="uk-navbar-nav">
                                    <li>
                                        <a href>Slide Right</a>
                                        <div class="uk-dropbar uk-dropbar-right" uk-drop="target-y: !.uk-navbar-container; stretch: y; animation: slide-right; animate-out: true">
                                            <ul class="uk-nav uk-navbar-dropdown-nav">
                                                <li class="uk-active"><a href="#">Active</a></li>
                                                <li><a href="#">Item</a></li>
                                                <li><a href="#">Item</a></li>
                                            </ul>
                                        </div>
                                    </li>
                                </ul>

                            </div>
                        </nav>

                    </div>
                </div>
            </div>

            <h2>Stretch + Overflow Content</h2>

            <div class="uk-child-width-1-4@m" uk-grid>
                <div>
                    <div class="test-boundary uk-overflow-auto uk-height-large uk-resize-vertical">

                        <nav class="uk-navbar-container" uk-navbar>
                            <div class="uk-navbar-center">

                                <ul class="uk-navbar-nav">
                                    <li>
                                        <a href>Fade</a>
                                        <div class="uk-dropbar uk-dropbar-top" uk-drop="target-y: !.uk-navbar-container; stretch: true; animate-out: true">

                                            <ul class="uk-nav uk-navbar-dropdown-nav">
                                                <li class="uk-active"><a href="#">Active</a></li>
                                                <li class="uk-parent">
                                                    <a href="#">Parent</a>
                                                    <ul class="uk-nav-sub">
                                                        <li><a href="#">Sub item</a></li>
                                                        <li><a href="#">Sub item</a>
                                                            <ul>
                                                                <li><a href="#">Sub item</a></li>
                                                                <li><a href="#">Sub item</a></li>
                                                            </ul>
                                                        </li>
                                                    </ul>
                                                </li>
                                                <li class="uk-parent">
                                                    <a href="#">Parent</a>
                                                    <ul class="uk-nav-sub">
                                                        <li class="uk-active"><a href="#">Active</a></li>
                                                        <li><a href="#">Sub item</a></li>
                                                    </ul>
                                                </li>
                                                <li class="uk-nav-header">Header</li>
                                                <li><a href="#"><span class="uk-margin-xsmall-right" uk-icon="icon: table"></span> Item</a></li>
                                                <li><a href="#"><span class="uk-margin-xsmall-right" uk-icon="icon: thumbnails"></span> Item</a></li>
                                                <li class="uk-nav-divider"></li>
                                                <li><a href="#"><span class="uk-margin-xsmall-right" uk-icon="icon: trash"></span> Item</a></li>
                                            </ul>

                                        </div>
                                    </li>
                                </ul>

                            </div>
                        </nav>

                    </div>
                </div>
                <div>
                    <div class="test-boundary uk-overflow-auto uk-height-large uk-resize-vertical">

                        <nav class="uk-navbar-container" uk-navbar>
                            <div class="uk-navbar-center">

                                <ul class="uk-navbar-nav">
                                    <li>
                                        <a href>Slide Top</a>
                                        <div class="uk-dropbar uk-dropbar-top" uk-drop="target-y: !.uk-navbar-container; stretch: true; animation: slide-top; animate-out: true">

                                            <ul class="uk-nav uk-navbar-dropdown-nav">
                                                <li class="uk-active"><a href="#">Active</a></li>
                                                <li class="uk-parent">
                                                    <a href="#">Parent</a>
                                                    <ul class="uk-nav-sub">
                                                        <li><a href="#">Sub item</a></li>
                                                        <li><a href="#">Sub item</a>
                                                            <ul>
                                                                <li><a href="#">Sub item</a></li>
                                                                <li><a href="#">Sub item</a></li>
                                                            </ul>
                                                        </li>
                                                    </ul>
                                                </li>
                                                <li class="uk-parent">
                                                    <a href="#">Parent</a>
                                                    <ul class="uk-nav-sub">
                                                        <li class="uk-active"><a href="#">Active</a></li>
                                                        <li><a href="#">Sub item</a></li>
                                                    </ul>
                                                </li>
                                                <li class="uk-nav-header">Header</li>
                                                <li><a href="#"><span class="uk-margin-xsmall-right" uk-icon="icon: table"></span> Item</a></li>
                                                <li><a href="#"><span class="uk-margin-xsmall-right" uk-icon="icon: thumbnails"></span> Item</a></li>
                                                <li class="uk-nav-divider"></li>
                                                <li><a href="#"><span class="uk-margin-xsmall-right" uk-icon="icon: trash"></span> Item</a></li>
                                            </ul>

                                        </div>
                                    </li>
                                </ul>

                            </div>
                        </nav>

                    </div>
                </div>
                <div>
                    <div class="test-boundary uk-overflow-auto uk-height-large uk-resize-vertical">

                        <nav class="uk-navbar-container" uk-navbar>
                            <div class="uk-navbar-center">

                                <ul class="uk-navbar-nav">
                                    <li>
                                        <a href>Slide Left</a>
                                        <div class="uk-dropbar uk-dropbar-left" uk-drop="target-y: !.uk-navbar-container; stretch: true; animation: slide-left; animate-out: true">

                                            <ul class="uk-nav uk-navbar-dropdown-nav">
                                                <li class="uk-active"><a href="#">Active</a></li>
                                                <li class="uk-parent">
                                                    <a href="#">Parent</a>
                                                    <ul class="uk-nav-sub">
                                                        <li><a href="#">Sub item</a></li>
                                                        <li><a href="#">Sub item</a>
                                                            <ul>
                                                                <li><a href="#">Sub item</a></li>
                                                                <li><a href="#">Sub item</a></li>
                                                            </ul>
                                                        </li>
                                                    </ul>
                                                </li>
                                                <li class="uk-parent">
                                                    <a href="#">Parent</a>
                                                    <ul class="uk-nav-sub">
                                                        <li class="uk-active"><a href="#">Active</a></li>
                                                        <li><a href="#">Sub item</a></li>
                                                    </ul>
                                                </li>
                                                <li class="uk-nav-header">Header</li>
                                                <li><a href="#"><span class="uk-margin-xsmall-right" uk-icon="icon: table"></span> Item</a></li>
                                                <li><a href="#"><span class="uk-margin-xsmall-right" uk-icon="icon: thumbnails"></span> Item</a></li>
                                                <li class="uk-nav-divider"></li>
                                                <li><a href="#"><span class="uk-margin-xsmall-right" uk-icon="icon: trash"></span> Item</a></li>
                                            </ul>

                                        </div>
                                    </li>
                                </ul>

                            </div>
                        </nav>

                    </div>
                </div>
                <div>
                    <div class="test-boundary uk-overflow-auto uk-height-large uk-resize-vertical">

                        <nav class="uk-navbar-container" uk-navbar>
                            <div class="uk-navbar-center">

                                <ul class="uk-navbar-nav">
                                    <li>
                                        <a href>Slide Right</a>
                                        <div class="uk-dropbar uk-dropbar-right" uk-drop="target-y: !.uk-navbar-container; stretch: true; animation: slide-right; animate-out: true">

                                            <ul class="uk-nav uk-navbar-dropdown-nav">
                                                <li class="uk-active"><a href="#">Active</a></li>
                                                <li class="uk-parent">
                                                    <a href="#">Parent</a>
                                                    <ul class="uk-nav-sub">
                                                        <li><a href="#">Sub item</a></li>
                                                        <li><a href="#">Sub item</a>
                                                            <ul>
                                                                <li><a href="#">Sub item</a></li>
                                                                <li><a href="#">Sub item</a></li>
                                                            </ul>
                                                        </li>
                                                    </ul>
                                                </li>
                                                <li class="uk-parent">
                                                    <a href="#">Parent</a>
                                                    <ul class="uk-nav-sub">
                                                        <li class="uk-active"><a href="#">Active</a></li>
                                                        <li><a href="#">Sub item</a></li>
                                                    </ul>
                                                </li>
                                                <li class="uk-nav-header">Header</li>
                                                <li><a href="#"><span class="uk-margin-xsmall-right" uk-icon="icon: table"></span> Item</a></li>
                                                <li><a href="#"><span class="uk-margin-xsmall-right" uk-icon="icon: thumbnails"></span> Item</a></li>
                                                <li class="uk-nav-divider"></li>
                                                <li><a href="#"><span class="uk-margin-xsmall-right" uk-icon="icon: trash"></span> Item</a></li>
                                            </ul>

                                        </div>
                                    </li>
                                </ul>

                            </div>
                        </nav>

                    </div>
                </div>
            </div>

            <h2>Position + Click</h2>

            <div class="uk-child-width-1-3@m" uk-grid>
                <div>
                    <div class="test-boundary uk-overflow-auto uk-height-large uk-resize-vertical">

                        <nav class="uk-navbar-container uk-navbar-transparent" uk-navbar>
                            <div class="uk-navbar-left">

                                <a class="uk-navbar-item uk-logo" href="#">Below</a>

                            </div>
                            <div class="uk-navbar-right">

                                <a href class="uk-navbar-toggle uk-navbar-toggle-animate" uk-navbar-toggle-icon></a>
                                <div class="uk-dropbar uk-dropbar-top" uk-drop="mode: click; target-y: !.uk-navbar-container; stretch: true; animation: slide-top; animate-out: true">

                                    <div class="uk-height-1-1 uk-flex uk-flex-center uk-flex-middle">
                                        <ul class="uk-nav uk-navbar-dropdown-nav">
                                            <li class="uk-active"><a href="#">Active</a></li>
                                            <li><a href="#">Item</a></li>
                                            <li><a href="#">Item</a></li>
                                            <li><a href="#">Item</a></li>
                                        </ul>
                                    </div>

                                </div>

                            </div>
                        </nav>

                    </div>
                </div>
                <div>
                    <div class="test-boundary uk-overflow-auto uk-height-large uk-resize-vertical">

                        <nav class="uk-navbar-container uk-navbar-transparent" uk-navbar>
                            <div class="uk-navbar-left">

                                <a class="uk-navbar-item uk-logo" href="#">Above</a>

                            </div>
                            <div class="uk-navbar-right">

                                <a href class="uk-navbar-toggle uk-navbar-toggle-animate uk-position-z-index" uk-navbar-toggle-icon></a>
                                <div class="uk-dropbar uk-dropbar-top uk-position-z-index-zero" uk-drop="mode: click; inset: true; pos: top-center; stretch: true; animation: slide-top; animate-out: true">

                                    <div class="uk-height-1-1 uk-flex uk-flex-center uk-flex-middle">
                                        <ul class="uk-nav uk-navbar-dropdown-nav">
                                            <li class="uk-active"><a href="#">Active</a></li>
                                            <li><a href="#">Item</a></li>
                                            <li><a href="#">Item</a></li>
                                            <li><a href="#">Item</a></li>
                                        </ul>
                                    </div>

                                </div>

                            </div>
                        </nav>

                    </div>
                </div>
                <div>
                    <div class="test-boundary uk-overflow-auto uk-height-large uk-resize-vertical">

                        <nav class="uk-navbar-container uk-navbar-transparent uk-position-z-index" uk-navbar>
                            <div class="uk-navbar-left">

                                <a class="uk-navbar-item uk-logo" href="#">Behind</a>

                            </div>
                            <div class="uk-navbar-right">

                                <a href class="uk-navbar-toggle uk-navbar-toggle-animate" uk-navbar-toggle-icon></a>
                                <div class="uk-dropbar uk-dropbar-top uk-position-z-index-negative" uk-drop="mode: click; inset: true; pos: top-center; stretch: true; animation: slide-top; animate-out: true">

                                    <div class="uk-height-1-1 uk-flex uk-flex-center uk-flex-middle">
                                        <ul class="uk-nav uk-navbar-dropdown-nav">
                                            <li class="uk-active"><a href="#">Active</a></li>
                                            <li><a href="#">Item</a></li>
                                            <li><a href="#">Item</a></li>
                                            <li><a href="#">Item</a></li>
                                        </ul>
                                    </div>

                                </div>

                            </div>
                        </nav>

                    </div>
                </div>
            </div>

        </div>

        <script>

            const {$$, addClass, on, removeClass } = UIkit.util;

            on('#js-size-switcher', 'change', (e) => {
                const options = $$('option', e.target).map(({value}) => value);
                for (const dropbar of $$('.uk-dropbar')) {
                    removeClass(dropbar, options);
                    addClass(dropbar, e.target.value);
                }
            });

        </script>

    </body>
</html>
